﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Guline.SupportCMS
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapRoute(
               "paging-videocategory", // Route name
               "video/{Name}-c{ID}/page-{Page}", // URL with parameters
               new { controller = "Subject", action = "Video" } // Parameter defaults ,
               , new { ID = @"\d+", Page = @"\d+" }
           );
            routes.MapRoute(
                "paging-category", // Route name
                "{Name}-c{ID}/page-{Page}", // URL with parameters
                new { controller = "Subject", action = "Detail" } // Parameter defaults ,
                , new { ID = @"\d+",Page=@"\d+" }
            );
            routes.MapRoute(
                  "video-writecontent", // Route name
                  "video/{Name}-v{ID}", // URL with parameters
                  new { controller = "Content", action = "Video" } // Parameter defaults ,
                  , new { ID = @"\d+" }
              );
            routes.MapRoute(
                  "cattegory-writecontent", // Route name
                  "{Name}-c{ID}", // URL with parameters
                  new { controller = "Subject", action = "Detail" } // Parameter defaults ,
                  , new { ID = @"\d+" }

              );
            routes.MapRoute(
                  "baiviet-writecontent", // Route name
                  "{Name}-post{ID}", // URL with parameters
                  new { controller = "Content", action = "Detail" } // Parameter defaults ,
                  , new { ID = @"\d+" }

              );
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}